﻿using System;
using System.ComponentModel;
using System.Runtime.Serialization;

namespace Vintner.Sales.Preferences
{
    public partial class PrintInvoicesPreferencePanel : PrintInvoicesPreferencePanelNoVis
    {
        public PrintInvoicesPreferencePanel()
            : base()
        {
            InitializeComponent();
        }

        public PrintInvoicesPreferencePanel(string appName)
            : base(appName)
        {
            InitializeComponent();
            ButtonText = Properties.Resources.T_SaleNo;
            ButtonImage = Properties.Resources.B_Sales;
        }

        protected override void OnBindData()
        {
            BindControl(nudCopies, "NoCopies", "Value");
        }
    }

    #region PrintInvoicePreferencePanelNoVis

    public partial class PrintInvoicesPreferencePanelNoVis : ApplicationLibrary.Preferences.GenericPreferencePanel<PrintInvoicesPref>
    {
        public PrintInvoicesPreferencePanelNoVis()
        { }

        public PrintInvoicesPreferencePanelNoVis(string appName)
            : base(appName, null)
        {
        }
    }

    #endregion

    [DataContract]
    public class PrintInvoicesPref
    {
        [DataMember]
        public int NoCopies { get; set; }

        public PrintInvoicesPref()
        {
        }
    }
}